package com.liury.bbs.mapper;

import com.liury.bbs.entity.Kind;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface KindMapper {
    @Select("select * from kind")
    public List<Kind> find();

    @Select("select * from kind where id=#{id}")
    public Kind get(int kindid);

    @Insert("insert kind (name,memo) values(#{name},#{memo})")
    public void insertType(Kind kind);

    @Delete("delete from kind where id=#{id}")
    public void deleteType(Integer id);

    @Update("update kind set name=#{name},memo=#{memo} where id=#{id}")
    public void updateType(Kind kind);
}
